package com.zdft.promotion.common.dao;

import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.type.JdbcType;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

/**
 * 抽象DAO实现
 */
@Component
public class SqlSessionFactoryInitializer {
    /**
     * sql会话工厂
     */
    @Resource
    private SqlSessionFactory sqlSessionFactory;

    @PostConstruct
    public void initNamespace() {
        sqlSessionFactory.getConfiguration().setJdbcTypeForNull(JdbcType.NULL);
    }
}
